package com.huzz.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
* 系统部门 新建Model
*
* @author 童年的纸飞机
* @since 2023-06-07 11:25
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@ApiModel("系统部门 新建Model Args")
public class SysDepartmentCreateModel implements Serializable {

    // TODO javax validation: @NotBlank | @NotNull

    @NotBlank(message = "name不能为null,也不能为空串")
    @ApiModelProperty(value = "部门名称")
    private String name;

    @ApiModelProperty(value = "部门描述")
    private String description;

    @NotNull(message = "status不能为空")
    @ApiModelProperty(value = "状态(1开启,0关闭)")
    private Integer status;

    @NotNull(message = "parentId不能为空")
    @ApiModelProperty(value = "父级id(默认0为根部门)")
    private Integer parentId;

    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", message = "phone填写格式不正确")
    @ApiModelProperty(value = "部门电话")
    private String phone;

}